#include <QGuiApplication>
#include <QQmlApplicationEngine>

#include "appengine.h"

int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    // QQmlApplicationEngine engine;

    AppEngine *engine = AppEngine::getInstance();

    QObject::connect(
        engine,
        &QQmlApplicationEngine::objectCreationFailed,
        &app,
        []() { QCoreApplication::exit(-1); },
        Qt::QueuedConnection);
    engine->loadFromModule("CNC_Double_Head_Saws_Horizontal", "Main");

    QObject::connect(&app, &QGuiApplication::aboutToQuit, []() { AppEngine::destroyInstance(); });

    return app.exec();
}
